var config=require('./index');
var Sequelize=require('sequelize');
var logger=require('../support/logger');
var sequelize = new Sequelize('portdatas', config.database.username, config.database.password, {
    host: config.database.host,
    port: config.database.port,
    dialect: config.database.dialect,
    pool: {
      max: 5,
      min: 0,
      idle: 10000
    },
    logging: logger.info
  });

  var portdatas=sequelize.define('portdatas',{
      portName:{
        type: Sequelize.STRING
      },
      route:{
        type: Sequelize.STRING
      },
      jsonData:{
        type: Sequelize.STRING
      },
      listNum:{
        type:Sequelize.STRING
      }
  })

  //单独运行，可重建数据表
  if(require.main===module){
      portdatas.sync({
          force:true
      });
  }
  exports.portdatas=portdatas;
